Skip to content

host/fabric: harden root marker, secrets, dashboard auth & chain routing - #405

Merged
FujitsuPolycom merged 3 commits into
mainfrom
fix/host-fabric-hardening
Nov 30, 2026
Merged

FujitsuPolycom merged 3 commits into
mainfrom
fix/host-fabric-hardening

Conversation

@FujitsuPolycom

Copy link
Copy Markdown
Owner

Why

Close host security, privilege-boundary, daemon conflict, open-chain routing, and installer bugs affecting multi-Spark rings and chains.

What Changed

  • Root-owned SHA-256 marker (fabric/commands.py, state.py, diff.py, cli.py): Install ring8-mesh-marker to /usr/local/libexec/sparkring/ring8-mesh-marker via sudo -n install instead of executing user-writable /var/tmp/ring8-mesh-marker; verify uid == 0, mode & 0o022 == 0, and SHA-256 before running.
  • First-class open chains & route validation (routes.py, fabric/plan.py): Add BFS connectivity checks to Fabric.kind, sparse --ring-only validation to validate_route_map, and open-chain relay planning (ChainGroup / build_chain_plan).
  • Atomic secret writes & dashboard/service hardening (runtime/host/, packaging/debian/): Eliminate 0644 write-then-chmod TOCTOU on WireGuard keys and secrets (O_CREAT|O_EXCL + fchmod); switch dashboard Basic Auth to hmac.compare_digest and default to loopback (127.0.0.1), failing closed on unauthenticated LAN bind unless --allow-unauthenticated-lan is explicit; align status/recovery JSONs to 0640; add MaxConnections=16 to sparkring-helper.socket + bounded streaming subprocess capture in helper.py; disable AllowTcpForwarding on seed/access services and sanitize sudoers.d filenames.
  • Stop daemon tug-of-war & widen hairpin checks (node.py, relays.py, recovery.py): Teach sparkring-agent to yield cleanly (yielded_to_sircl_fabric) when /run/sparkring-fabric/relay-state.json is active instead of overwriting proto 82 routes every 30s; run ConnectX hairpin checks on all >= 3 rank layouts (4/6/8 Sparks).
  • Installers (install.sh, bootstrap.sh): Run apt-get update before apt-get install, quote globs, add aarch64 guard + /dev/tty prompt in bootstrap.sh, and clean up ~/.local/bin/sparkring shadowing /usr/bin/sparkring.

Verification

  • pytest across spark_transport/sircl/tests/ (197 passed), host security/dashboard/workflow suites (475 passed), test_relays/test_recovery/test_node_status (110 passed), helper/privilege/sudoers (16 passed), and WSL Linux POSIX tests (test_helper/test_privilege/test_ring_halves 63/63).
  • ruff check (0 issues across 33 Python files) and bash -n install.sh bootstrap.sh (exit 0).

Risks / Follow-Ups

  • Unauthenticated LAN dashboard deployments now require --password-file or explicit --allow-unauthenticated-lan.
  • Existing hosts running /var/tmp/ring8-mesh-marker will automatically migrate to /usr/local/libexec/sparkring/ring8-mesh-marker on next fabric apply.

@FujitsuPolycom
FujitsuPolycom force-pushed the fix/host-fabric-hardening branch from aad4d26 to 32b722f Compare November 30, 2026 06:03
@FujitsuPolycom
FujitsuPolycom merged commit 1af3721 into main Nov 30, 2026
11 checks passed
@FujitsuPolycom
FujitsuPolycom deleted the fix/host-fabric-hardening branch November 30, 2026 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant